package com.example.zuoye.service.impl;

import com.example.zuoye.dao.GoodDAO;
import com.example.zuoye.entity.Good;
import com.example.zuoye.service.GoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodServiceImpl implements GoodService {

    @Autowired
    private GoodDAO goodDAO;

    @Override
    public Good selectGoodInfoByNameAndIntroduce(String good_name, String good_introduce) {
        return goodDAO.selectGoodInfoByNameAndIntroduce(good_name,good_introduce);
    }

    @Override
    public Good selectGoodInfoByName(String good_name) {
        return goodDAO.selectGoodInfoByName(good_name);
    }

    @Override
    public List<Good> selectGoodInfo() { return goodDAO.selectGoodInfo(); }

    @Override
    public int insertGoodInfo(String good_name,String good_introduce,String good_price,String good_date,Integer good_number,String good_image) {
        return goodDAO.insertGoodInfo(good_name,good_introduce,good_price,good_date,good_number,good_image);
    }

    @Override
    public int deleteGoodInfoByNameAndIntroduce(String good_name, String good_introduce) {
        return goodDAO.deleteGoodInfoByNameAndIntroduce(good_name,good_introduce);
    }

    @Override
    public int deleteGoodInfoById(Integer good_id) {
        return goodDAO.deleteGoodInfoById(good_id);
    }

    @Override
    public int updateGoodInfoById(Integer good_id,String good_name, String good_introduce, String good_price, String good_date, Integer good_number, String good_image) {
        return goodDAO.updateGoodInfoById(good_id,good_name,good_introduce,good_price,good_date,good_number,good_image);
    }
}
